package com.example.work2

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView

class MeFragment : Fragment(){
    private val p_msgList=ArrayList<P_Msg>()
    private var adapter:FxAdapter?=null
    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        val view=inflater.inflate(R.layout.me_fragment, container, false)
        initPMSG()
        val wc=view.findViewById(R.id.meView) as RecyclerView
        val layoutManager= LinearLayoutManager(activity)
        wc.layoutManager=layoutManager
        adapter= FxAdapter(p_msgList)
        wc.adapter=adapter
        return view
    }
    private fun initPMSG(){
        p_msgList.add(P_Msg("服务",R.mipmap.me3))
        p_msgList.add(P_Msg("收藏",R.mipmap.me4))
        p_msgList.add(P_Msg("朋友圈",R.mipmap.me5))
        p_msgList.add(P_Msg("卡包",R.mipmap.me6))
        p_msgList.add(P_Msg("表情",R.mipmap.me7))
        p_msgList.add(P_Msg("设置",R.mipmap.me8))
    }
}